//
//  MPCPageLoadingView.h
//  MPTCustomUILibrary
//
//  Created by macRong on 2017/8/31.
//  Copyright © 2017年 jxzjxz. All rights reserved.
//

#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN

typedef void(^ReAction)();

@interface MPCPageLoadingView : UIView

/**
 图片和文字整体是否居中?
 default: NO 图片和文字整体向上60像素, 规范，不要暴露随意修改
 YES: 居中
 */
@property(nonatomic,getter=isCenterY) BOOL centerY;

/**
 🚫禁止使用new
 */
+ (instancetype)new __attribute__((unavailable("🚫new invalid")));


/**
 pageLoading闪动

 @param imageName 底图
 @param shineImageName 闪图
 */
- (void)showLoadingViewWithImageName:(NSString *)imageName
                      shineImageName:(NSString *)shineImageName;

/**
 显示没网络View

 @param imageName imageName
 @param hintTitle 提示文字
 @param buttonTitle 按钮文字
 @param action action
 */
- (void)showNonNetViewWithImageName:(NSString *)imageName
                          hintTitle:(nullable NSString *)hintTitle
                        buttonTitle:(NSString *)buttonTitle
                             action:(ReAction)action;

- (void)showNonNetViewWithImageName:(NSString *)imageName hintTitle:(NSString *)hintTitle msg:(NSString *)msg buttonTitle:(NSString *)buttonTitle action:(ReAction)action;

/**
 显示没有数据View

 @param imageName imageName
 @param hintTitle 提示文字
 @param action action
 */
- (void)showNotDataViewWithImageName:(NSString *)imageName
                           hintTitle:(nullable NSString *)hintTitle
                              action:(ReAction)action;

- (void)showNotDataViewWithImageName:(NSString *)imageName
                           hintTitle:(nullable NSString *)hintTitle
                            subTitle:(nullable NSString *)subTitle
                              action:(ReAction)action;

- (void)showNotDataViewWithHintTitle:(nullable NSString *)hintTitle
                              action:(ReAction)action;
/**
 显示错误View

 @param hintTitle 提示文字
 @param buttonTitle 按钮文字
 @param action action
 */
- (void)showFailViewWithHintTitle:(nullable NSString *)hintTitle
                        buttonTitle:(NSString *)buttonTitle
                             action:(ReAction)action;


/**
 hudLoading

 @param imageName imageName
 @param hintTitle hintTitle
 */
- (void)showHudWithImageName:(NSString *)imageName
                       title:(nullable NSString *)hintTitle;

/**
 显示重试按钮

 @param buttonTitle 按钮文字
 @param action action
 */
- (void)showRetryButton:(NSString *)buttonTitle
                 action:(ReAction)action;

/**
 removeSELFView && 动画停止
 */
- (void)removePageLoadingView;


@end

NS_ASSUME_NONNULL_END


/** Example:
 
 MPCPageLoadingView *pageLoadingView = [[MPCPageLoadingView alloc]init];
 [self.loadingView addSubview:pageLoadingView];
 
 [pageLoadingView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.edges.equalTo(self.loadingView);
 }];
 
 [pageLoadingView showLoadingViewWithImageName:@"shimmerLogo" shineImageName:@"shimmerDefaultLogo"];

 
*/


